package demo4;

class Outer1 {
    public int a = 1;
    private int b = 2;
    public static int c = 3;
    static class Inner {
        public int x = 1;
        private int y = 2;
        public static int z = 3;
        public void test() {
            System.out.println(x); //1
            System.out.println(c); //3
            Outer1 outer1 = new Outer1();
            System.out.println(outer1.a); //1
            System.out.println("内部类");
        }

    }
}

public class Test3 {
    public void test() {
        //局部内部类
        class Inner {
            public int num = 1;
        }
        Inner inner = new Inner();
        System.out.println(inner.num);
    }
    public static void main(String[] args) {

        Outer1.Inner inner = new Outer1.Inner();
        inner.test();

    }
}
